package com.yunji.cabinet.service.impl;

import com.yunji.cabinet.bo.CabinetSiteListQueryBO;
import com.yunji.cabinet.dao.ICabinetSiteDao;
import com.yunji.cabinet.domain.CabinetSiteDO;
import com.yunji.cabinet.service.ICabinetSiteService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * @version 1.0
 * @Project: yunji-coffee
 * @Package com.yunji.cabinet.service.impl
 * @FileName CabinetSiteServiceImpl.java
 * @Copyright Copyright © 2024 云集互联. All Rights Reserved
 * Company		com
 * @CreateTime 2024-04-09 18:05:44
 * @Description 货柜网点接口实现
 * @Modification Author                    History Time			Version				Description
 * --------------------------------------------------------------------------------
 * HuaAo				2024-04-09 18:05:44		1.0					1.0 Version
 * @since JDK 1.8.0_202
 */
@Component
public class CabinetSiteServiceImpl implements ICabinetSiteService {

    @Resource
    private ICabinetSiteDao cabinetSiteDao;

    /**
     * @return boolean 新增结果
     * @Title create
     * @Desc 新增货柜站点信息
     * @Date 2024-04-10 09:51:23
     * @Param containerSite 货柜站点信息
     */
    @Override
    public boolean create(CabinetSiteDO containerSite) {
        return cabinetSiteDao.save(containerSite);
    }

    /**
     * @return boolean 删除结果
     * @Title delete
     * @Desc 删除货柜站点信息
     * @Date 2024-04-10 09:51:56
     * @Param ids 货柜ID集合
     */
    @Override
    public boolean deleteByContainerIds(Long... ids) {
        return cabinetSiteDao.deleteByContainerIds(ids);
    }

    /**
     * @param ids 网点ID
     * @Title selectContainerSiteByIds
     * @Desc 根据网点获取货柜绑定信息
     * @Date 2024-05-28 19:57:42.568
     * @Return List<ContainerSite> 货柜绑定信息
     */
    @Override
    public List<CabinetSiteDO> searchBySiteIds(Long... ids) {
        return cabinetSiteDao.searchBySiteIds(ids);
    }

    @Override
    public CabinetSiteDO selectByContainerId(Long containerId) {
        return cabinetSiteDao.getCabinetSiteByCid(containerId);
    }

    @Override
    public List<CabinetSiteDO> search(CabinetSiteListQueryBO bo) {
        return cabinetSiteDao.search(bo);
    }
}
